import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { PlantFlowerInfo } from "./info/PlantFlowerInfo";
type int = number;
//class PlantFlowerConfig
    
    export  class PlantFlowerConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (PlantFlowerConfig._instance != null) 
            {
                throw new Error(" PlantFlowerConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_plant_flower.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new PlantFlowerInfo(loc2);
                this._map[loc1.bossid] = loc1;
            }
            return;
        }

        public getPlantAward(arg1: int): Array<any>
        {
            var loc1=this._map[arg1] as PlantFlowerInfo;
            if (loc1) 
            {
                return loc1.plantAwardShow;
            }
            return [];
        }

        public getBlessAward(arg1: int): Array<any>
        {
            var loc1=this._map[arg1] as PlantFlowerInfo;
            if (loc1) 
            {
                return loc1.blessAwardShow;
            }
            return [];
        }

        public static get instance(): PlantFlowerConfig
        {
            if (PlantFlowerConfig._instance == null) 
            {
                PlantFlowerConfig._instance = new PlantFlowerConfig();
            }
            return PlantFlowerConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PlantFlowerConfig;
    }
